<%@ Page Language="C#" AutoEventWireup="true" Inherits="Syrinx.Gui.AspNet.Nitobi2.NitobiBasePage" 
	 MasterPageFile="~/App_ThemeMasters/NoStyle/AdminOneColumnLayout.Master" %>
<%@ Register Assembly="Swaf.Gui.AspNet2" Namespace="Swaf.Gui.AspNet2" TagPrefix="swf" %>
<%@ Register Assembly="ScsAspNet" Namespace="Syrinx.Gui.AspNet.Nitobi2" TagPrefix="snc" %><%@ Register Assembly="NitobiControls" Namespace="Nitobi" TagPrefix="ntb" %>

<!--#include file="~/SiteControls/RegisterStandardControls.txt"-->
<!--#include file="../SiteControls/StandardHeaderPageContent.inc"-->
<!--#include file="../SiteControls/StandardFooterPageContent.inc"-->

<asp:Content ContentPlaceHolderID="title" ID="c01" runat="server">
	<%SecurityPrivilege="AppFunctions.SetupCompany"; %>
	<div class="left"><h1><asp:Label ID="ImgCacheLibLbl" runat="server" >Image Cache Library</asp:Label></h1></div>
	<swf:BizProc ID="settings" runat="server" FactoryName="mediaCache">
	</swf:BizProc>

	 <swf:BizProc runat="server" ID="adl" factoryName="mediaDirectoryLibrary">
		<State entireTree="false" includeSelf="true" />
		<ParentBizProc id="settings" fieldName="id" dataId="pid" />
	</swf:BizProc>
	<swf:BizProc runat="server" ID="ail" FactoryName="mediaImagesLibrary">
		<ParentBizProc id="adl" fieldName="keyName" dataId="pid" />
		<ParentBizProc id="settings" fieldName="id" dataId="cid" />
	</swf:BizProc>
</asp:Content>

<asp:Content ContentPlaceHolderID="mainContent" ID="c02" runat="server">
	<table><tr>
	<td><asp:Label runat="server" ID="_ccLbl">Company Image Libraries:</asp:Label></td>
	<td>
		<snc:Combo ID="caches" runat="server" ParentBizProcIds="settings" DataTextField="name" Mode="Classic">
			<Columns>
				<ntb:BoundColumn DataField="id" Visible="false" />
				<ntb:BoundColumn DataField="name" HeaderText="Name" width="200" />
			</Columns>
		</snc:Combo>
	</td>
	</tr>
	</table>

	<table width="100%">
	<tr><td>
		<snc:Grid ID="dirs" runat="server" Width="250px" Height="450px"  ShowToolbar="false" ParentBizProcIds="adl" Mode="LiveScrolling" Resizable="Both" SelectionMode="Single">
			<Columns>
				<ntb:KeyColumn DataField="keyName" />
				<ntb:BoundColumn DataField="depthName" HeaderText="Name" width="200" />
				<ntb:BoundColumn DataField="fileCount" HeaderText="Num Files" width="40" />
			</Columns>
		</snc:Grid>
	</td><td width="100%">
<script type="text/javascript">
	function toggleTabs(cId,c1, dId)
	{
		var a;
		for(i=1; ;i++)
		{
			a = document.getElementById(cId + i);
			b = document.getElementById(dId + i);
			if(a==null || a=='')
				break;
				
			if(i==c1)
			{
				a.className = 'currenttab';
				b.style.display = 'block';
			}
			else
			{
				a.className='';
				b.style.display = 'none';
			}
		}
		
	}
</script>
	<div class="clearer"></div>
	<div class="outertabs">
	<div class="tabs" >
        <div>
		    <ul>
		        <li id="t1" class="currenttab"><div class="firstTab"><swf:DivLayers runat="server" ID="tl1" SkinID="Tab"><asp:HyperLink runat="server" ID="_tabs1" onclick="toggleTabs('t','1','ta')" NavigateUrl="javascript:;" Text="Directory Images"/></swf:DivLayers></div></li>
		        <li id="t2"><swf:DivLayers runat="server" ID="tl2" SkinID="Tab"><asp:HyperLink runat="server" ID="_tabs2" onclick="toggleTabs('t','2','ta')" NavigateUrl="javascript:;" Text="Upload Images" /></swf:DivLayers></li>
		        <li id="t3"><swf:DivLayers runat="server" ID="tl3" SkinID="Tab"><asp:HyperLink runat="server" ID="_tabs3" onclick="toggleTabs('t','3','ta')" NavigateUrl="javascript:;" Text="Directory Info" /></swf:DivLayers></li>
		        <li id="t4"><div class="lastTab"><swf:DivLayers runat="server" ID="tl4" SkinID="Tab"><asp:HyperLink runat="server" ID="_tabs4" onclick="toggleTabs('t','4','ta')"  NavigateUrl="javascript:;" Text="Cache Info" /></swf:DivLayers></div></li>
	        </ul>
        </div>
    </div>
	<div class="clearer"></div>
	<swf:DivLayers ID="mdl1" runat="server" SkinID="MainTabArea">
		<div id="ta1">
			<table><tr>
			<td>
				<span class="button5"><snc:ActionButton runat="server" ID="_mib1" Actions="ail.DeleteBizObj" Text="Delete Selected" ClientClick="if(!confirm('Are you sure you want to delete?'))return false;"/></span>
			</td>
			<td><asp:Label runat="server" ID="_mvLbl">Move Selected Images To:</asp:Label></td>
			<td>
				<snc:NitobiActionParamDropDown runat="server" id="moveAction" ParentBizProcIds="adl" Actions="ail.Move" DataTextField="shortDepthName" Mode="Classic" >
					<TextBox Width="200" />
					<List Width="225" Height="300" />
					<Columns>
						<ntb:BoundColumn DataField="keyName" Visible="false" />
						<ntb:BoundColumn DataField="shortDepthName" HeaderText="Name" />
					</Columns>
				</snc:NitobiActionParamDropDown>
			</td>
			</tr></table>		
            <div class="clearer"></div>
		
	        <snc:NitobiPaginationDisplay ID="pager2" runat="server" ParentBizProcIds="ail" 
				PagesClass="PagerPages" CurrentPageClass="PagerCurrentPage" CssClass="Pager" />
	        <snc:ComplexBizObjListDisplay runat="server" ID="miImages" 
		        ReadOnlyTemplate="MediaCache.Gui.AspNet.ImageListDisplay-CheckSelect"  MaxElements="25"
		        ParentBizProcIds="ail">
		        <macros>
			        <Entry name="navLink" type="String">imageviewer.aspx</Entry>
		        </macros>
	        </snc:ComplexBizObjListDisplay>
			<div class="clearer"></div>
	        <snc:NitobiPaginationDisplay ID="pager" runat="server" ParentBizProcIds="ail"
				PagesClass="PagerPages" CurrentPageClass="PagerCurrentPage" CssClass="Pager" />
		</div>		
	
		<div id="ta2" style="display:none;">
		    <iframe width="400" height="300" src="ImageUploadChild.aspx" frameborder="no" scrolling="auto">
		    </iframe>
		</div>

		<div id="ta3" style="display:none;">
			<span class="button1"><snc:ActionButton runat="server" ID="_mdb1" Actions="adl.AddBizObj" Text="Add" /></span>
			<span class="button6"><snc:ActionButton runat="server" ID="_mdb2" Actions="adl.UpdateBizObj" Text="Update" /></span>
			<span class="button1"><snc:ActionButton runat="server" ID="_mdb3" Actions="adl.CancelEdits" Text="Cancel" /></span>
			<span class="button5"><snc:ActionButton runat="server" ID="_mdb4" Actions="adl.DeleteBizObj" Text="Delete" ClientClick="if(!confirm('Are you sure you want to delete?'))return false;"/></span>

			<snc:NitobiBizObjDisplay ID="mdd1" runat="server" ParentBizProcIds="adl"
				ReadOnlyTemplate="MediaCache.Gui.AspNet.MediaDirectoryDetailsDisplay" />
		</div>
		
		<div id="ta4" style="display:none;">
			<span class="button1"><snc:ActionButton runat="server" ID="_csb1" Actions="settings.AddBizObj" Text="Add" /></span>
			<span class="button6"><snc:ActionButton runat="server" ID="_csb2" Actions="settings.UpdateBizObj" Text="Update" /></span>
			<span class="button1"><snc:ActionButton runat="server" ID="_csb3" Actions="settings.CancelEdits" Text="Cancel" /></span>
			<span class="button5"><snc:ActionButton runat="server" ID="_csb4" Actions="settings.DeleteBizObj" Text="Delete" ClientClick="if(!confirm('Are you sure you want to delete?'))return false;"/></span>
            <div class="clearer"></div>
			<snc:NitobiBizObjDisplay ID="cacheDet" runat="server" ParentBizProcIds="settings"
				ReadOnlyTemplate="MediaCache.Gui.AspNet.MediaCacheDetailsDisplay" />
				
			<swf:BizProc ID="cachScl" runat="server" FactoryName="cacheScalings">
				<ParentBizProc id="settings" fieldName="scalings" dataId="parent" fullDependency="True" />
			</swf:BizProc>
				<snc:Combo ID="scalings" runat="server" ParentBizProcIds="cachScl" Mode="Unbound" DataTextField="name">
					<Columns>
						<ntb:BoundColumn DataField="name" Visible="false" />
						<ntb:BoundColumn DataField="name" HeaderText="Name" width="200" />
					</Columns>
				</snc:Combo>
			
			<swf:BizProc ID="sclSet" runat="server" FactoryName="scalingSettings">
				<ParentBizProc id="cachScl" fieldName="adjustments" dataId="parent" fullDependency="True" />
			</swf:BizProc>
				<snc:ComplexBizObjListDisplay ParentBizProcIds="sclSet" runat="server" ID="ComplexBizObjListDisplay1" 
					ReadOnlyTemplate="MediaCache.Gui.AspNet.MediaCacheScalingDetailsDisplay-Editable"/>
			<span class="button1"><snc:ActionButton runat="server" ID="addBtn2" Actions="cachScl.AddBizObj" Text="Add" /></span>
			<span class="button6"><snc:ActionButton runat="server" ID="updateBtn2" Actions="cachScl.UpdateBizObj" Text="Update" /></span>
			<span class="button1"><snc:ActionButton runat="server" ID="cancleBtn2" Actions="cachScl.CancelEdits" Text="Cancel" /></span>
			<span class="button5"><snc:ActionButton runat="server" ID="deleteBtn2" Actions="cachScl.DeleteBizObj" Text="Delete" ClientClick="if(!confirm('Are you sure you want to delete?'))return false;"/></span>
		</div>
		</swf:DivLayers></div>
	</td></tr></table>
</asp:Content>

